<?php if(!defined('PHPOK_SET')){die('<h3>Error...</h3>');}?><?php QG_C_TEMPLATE::p("global_head","","0");?>
<?php QG_C_TEMPLATE::p("right.css","","0");?>
<?php QG_C_TEMPLATE::p("right.head","","0");?>

<!-- 玩家管理 -->
<?php if($sysAct == "add" || $sysAct == "modify"){?>
<div class="table2" style="text-align:left;">
	<a href="admin.php?file=index">系统首页</a> &raquo;
	<a href="admin.php?file=userkj&act=list">玩家建筑</a> &raquo;
	<?php if($sysAct == "add"){?>添加新建筑<?php }else{ ?>编辑建筑<?php } ?>
	<input type="button" value="建筑列表" onclick="qgurl('admin.php?file=userkj&act=list')">
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<form method="post" action="admin.php?file=userkj&act=viewok&id=<?php echo $id;?>" onsubmit="return add_msg();">
<tr>
	<td class="left">城池名称：<span style="color:red;">*</span></td>
	<td class="right">
		<input type="text" name="c_name" id="c_name" value="<?php echo $rsa[c_name];?>">
	</td>
</tr>
</table>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">所属玩家：<span style="color:red;">*</span></td>
	<td class="right">
		<input type="text" name="u_id" id="u_id" value="<?php echo $rsb[p_nickname];?>">
<span class="clue_on">[填写所属玩家的ID不是账号]</span>
	</td>
</tr>
</table>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">冶炼锻造：</td><td class="right">
<input type="text" name="s_smelt" id="s_smelt" value="<?php echo $rs[s_smelt];?>"></td></tr></table></div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">道路地图：</td><td class="right">
<input type="text" name="s_map" id="s_map" value="<?php echo $rs[s_map];?>"></td></tr></table></div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">军情刺探：</td><td class="right">
<input type="text" name="s_army" id="s_army" value="<?php echo $rs[s_army];?>"></td></tr></table></div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">部队指挥：</td><td class="right">
<input type="text" name="s_command" id="s_command" value="<?php echo $rs[s_command];?>"></td></tr></table></div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">士兵训练：</td><td class="right">
<input type="text" name="s_landform" id="s_landform" value="<?php echo $rs[s_landform];?>"></td></tr></table></div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">武器制造：</td><td class="right">
<input type="text" name="s_arm" id="s_arm" value="<?php echo $rs[s_arm];?>"></td></tr></table></div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">铠甲制造：</td><td class="right">
<input type="text" name="s_loricae" id="s_loricae" value="<?php echo $rs[s_loricae];?>"></td></tr></table></div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">马匹圈养：</td><td class="right">
<input type="text" name="s_gee" id="s_gee" value="<?php echo $rs[s_gee];?>"></td></tr></table></div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">防御加固：</td><td class="right">
<input type="text" name="s_recovery" id="s_recovery" value="<?php echo $rs[s_recovery];?>"></td></tr></table></div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">机械技术：</td><td class="right">
<input type="text" name="s_engine" id="s_engine" value="<?php echo $rs[s_engine];?>"></td></tr></table></div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">弹道技术：</td><td class="right">
<input type="text" name="s_trajectory" id="s_trajectory" value="<?php echo $rs[s_trajectory];?>"></td></tr></table></div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">采矿技术：</td><td class="right">
<input type="text" name="s_mining" id="s_mining" value="<?php echo $rs[s_mining];?>"></td></tr></table></div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">伐木技术：</td><td class="right">
<input type="text" name="s_cutting" id="s_cutting" value="<?php echo $rs[s_cutting];?>"></td></tr></table></div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">黄金提炼：</td><td class="right">
<input type="text" name="s_golds" id="s_golds" value="<?php echo $rs[s_golds];?>"></td></tr></table></div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">灌溉技术：</td><td class="right">
<input type="text" name="s_flooding" id="s_flooding" value="<?php echo $rs[s_flooding];?>"></td></tr></table></div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">钢铁精炼：</td><td class="right">
<input type="text" name="s_steel" id="s_steel" value="<?php echo $rs[s_steel];?>"></td></tr></table></div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">车轮改进：</td><td class="right">
<input type="text" name="s_wheel" id="s_wheel" value="<?php echo $rs[s_wheel];?>"></td></tr></table></div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">兵法专精：</td><td class="right">
<input type="text" name="s_tactics" id="s_tactics" value="<?php echo $rs[s_tactics];?>"></td></tr></table></div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">阵法专精：</td><td class="right">
<input type="text" name="s_position" id="s_position" value="<?php echo $rs[s_position];?>"></td></tr></table></div>




<?php $button_msg = $sysAct == "modify" ? "编辑建筑" : "添加玩家";;?>
<div class="table">
<table width="100%">
<tr>
	<td class="left"></td>
	<td class="right"><input type="submit" id="creat_button" class="mybutton_01" value="<?php echo $button_msg;?>"> &nbsp; <span id="show_step" style="color:red;"></span></td>
</tr>
</form>
</table>
</div>
<script type="text/javascript">
function add_msg(msg)
{
	var username = $("username").value;
	if(!username)
	{
		alert("账号不允许为空");
		return false;
	}

	$("show_step").innerHTML = "<img src='admin/tpl/images/loading.gif' border='0' align='absmiddle'> 正在保存数据，如果网页没有动静请刷新...";

	$("creat_button").disabled = true;
}
</script>

<?php }elseif($sysAct == "list"){ ?>
<div class="table2" style="text-align:left;">
	<a href="admin.php?file=index">系统首页</a> &raquo;
	玩家建筑
	<input type="button" value="添加新建筑" onclick="qgurl('admin.php?file=userkj&act=add')">
</div>

<div class="table">
	<table cellpadding="1" cellspacing="0">
	<form method="post" action="admin.php?file=userkj&act=list">
	<tr>
		<td><input type="text" name="keywords" id="keywords" value="<?php echo $keywords;?>"></td>
		<td>
			<select name="stype" id="stype">
			<option value="c_id"<?php if($stype == "c_id"){?> selected<?php } ?>>城池ID</option>
			<option value="u_id"<?php if($stype == "u_id"){?> selected<?php } ?>>玩家ID</option>
			<option value="b_id"<?php if($stype == "b_id"){?> selected<?php } ?>>建筑ID</option>
			</select>
		</td>
		<td>
			<input type="submit" value="搜索" class="mybutton_01">
		</td>
		</form>
	</tr>
	</table>
</div>

<table width="100%" cellpadding="0" cellspacing="0">
<tr>
	<td style="border-bottom:1px #D4D4D4 solid;"><img src="admin/tpl/images/blank.gif" border="0" width="1" height="1"></td>
</tr>
</table>

<table width="100%" cellpadding="0" cellspacing="0">
<tr class="table table2">
	<td height="23px" class="msg_subject_id b_b">建筑ID|</td>
	<td class="msg_subject b_b">玩家ID|</td>
	<td class="msg_subject b_b">城池id|</td>
	<td class="msg_subject b_b">冶炼锻造|</td>
	<td class="msg_subject b_b">道路地图|</td>
	<td class="msg_subject b_b">军情刺探|</td>
	<td class="msg_subject b_b">部队指挥|</td>
	<td class="msg_subject b_b">士兵训练|</td>
	<td class="msg_subject b_b">武器制造|</td>
	<td class="msg_subject b_b">铠甲制造|</td>
	<td class="msg_subject b_b">马匹圈养|</td>
	<td class="msg_subject b_b">防御加固|</td>
	<td class="msg_subject b_b">机械技术|</td>
	<td class="msg_postdate b_b">操作</td>
</tr>
<?php $_i=0;$rslist=(is_array($rslist))?$rslist:array();foreach($rslist AS  $key=>$valuea){$_i++; ?>
<tr class="m_out" onmouseover="this.className='m_over'" onmouseout="this.className='m_out'">
	<td height="25px" align="center" class="b_b"><?php echo $valuea[id];?></td>
	<td align="left" class="b_b"><?php echo $valuea[u_id];?></td>
	<td align="left" class="b_b"><?php echo $valuea[c_id];?></td>
	<td align="left" class="b_b"><?php echo $valuea[s_smelt];?></td>
	<td align="left" class="b_b"><?php echo $valuea[s_map];?></td>
	<td align="left" class="b_b"><?php echo $valuea[s_army];?></td>
	<td align="left" class="b_b"><?php echo $valuea[s_command];?></td>
	<td align="left" class="b_b"><?php echo $valuea[s_landform];?></td>
	<td align="left" class="b_b"><?php echo $valuea[s_arm];?></td>
	<td align="left" class="b_b"><?php echo $valuea[s_loricae];?></td>
	<td align="left" class="b_b"><?php echo $valuea[s_gee];?></td>
	<td align="left" class="b_b"><?php echo $valuea[s_recovery];?></td>
	<td align="left" class="b_b"><?php echo $valuea[s_engine];?></td>
	<td align="center" class="b_b">
		<input type="button" value="编辑" class="mybutton_01" onclick="qg_modify(<?php echo $valuea[c_id];?>)">
		<input type="button" value="删除" class="mybutton_01" onclick="qg_delete(<?php echo $valuea[c_id];?>)">
	</td>
</tr>
<?php } ?>
</table>
<div align="right"><?php echo $pagelist;?></div>
<script type="text/javascript">
function qg_modify(id)
{
	window.location.href="admin.php?file=userkj&act=modify&id="+id;
}
function qg_delete(id)
{
	//判断是否删除
	question = confirm("确认删除该信息吗？特别说明，删除后无法恢复！");
	if (question != "0")
	{
		qgurl("admin.php?file=userkj&act=delete&id="+id);
	}
}
</script>
<?php } ?>